package edu.unlv.cs.ladders.entities;

import edu.unlv.cs.ladders.entities.Score;
import java.lang.Long;
import java.util.List;

privileged aspect Score_Roo_Entity {
    
    public static long Score.countScores() {
        return (Long) entityManager().createQuery("select count(o) from Score o").getSingleResult();
    }
    
    public static List<Score> Score.findAllScores() {
        return entityManager().createQuery("select o from Score o").getResultList();
    }
    
    public static Score Score.findScore(Long id) {
        if (id == null) return null;
        return entityManager().find(Score.class, id);
    }
    
    public static List<Score> Score.findScoreEntries(int firstResult, int maxResults) {
        return entityManager().createQuery("select o from Score o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
    }
    
}
